#include <iostream>

class Rectangle
{
public:
    Rectangle(double width, double height);
    double area();
    double perimeter();
    void display();

private:
    double Width;
    double Height;
};

Rectangle::Rectangle(double width, double height)
{
    Width = width;
    Height = height;
}
double Rectangle::area()
{
    return Height * Width;
}

double Rectangle::perimeter()
{
    return (Height+Width)*2.0000000;
}

void Rectangle::display()
{
    std::cout<<"面积:"<<area()<<"\n"<<"周长:"<<perimeter()<<std::endl;
}

int main()
{
    double width,height;
    std::cout << "请输入矩形的宽度:";
    std::cin >> width;
    std::cout << "请输入矩形的高度:";
    std::cin >> height;
    Rectangle a(width, height);
    a.display();
    return 0;
}
